using System.Collections.Generic;
using System.Web.UI.WebControls;

namespace Code5Systems.FormMaster.Business
{
	public class FieldRulesScriptInfo
	{
		private FormFieldRulesInfo _sourceFieldInfo;
		private Dictionary<string, FormControlInfo> _targetInfoFields;
		private Dictionary<string, WebControl> _targetControls;
		private List<Label> _targetLabelCtls;
		private List<BaseValidator> _targetValidators;
		
		public FieldRulesScriptInfo(FormFieldRulesInfo sourcdInfo)
		{
			this._sourceFieldInfo = sourcdInfo;
		}
		
		public FormFieldRulesInfo SourceField
		{
			get
			{
				return this._sourceFieldInfo;
			}
		}
		
		public Dictionary<string, FormControlInfo> TargetControlInfos
		{
			get
			{
				if (_targetInfoFields == null)
				{
					_targetInfoFields = new Dictionary<string, FormControlInfo>();
				}
				return _targetInfoFields;
			}
		}
		
		public Dictionary<string, WebControl> TargetControls
		{
			get
			{
				if (_targetControls == null)
				{
					_targetControls = new Dictionary<string, WebControl>();
				}
				return _targetControls;
			}
		}
		
		public List<Label> TargetLabels
		{
			get
			{
				if (_targetLabelCtls == null)
				{
					_targetLabelCtls = new List<Label>();
				}
				return _targetLabelCtls;
			}
		}
		
		public List<BaseValidator> TargetValidators
		{
			get
			{
				if (_targetValidators == null)
				{
					_targetValidators = new List<BaseValidator>();
				}
				return _targetValidators;
			}
		}
		
	}
}

